package khiem.java.sample.genericgrapth;

import java.util.HashSet;
import java.util.Set;

import com.google.common.collect.Sets;

public class TestSetView {
  public static void main(String[] args) {
    Set<Integer> set1 = new HashSet<>();
    Set<Integer> set2 = new HashSet<>();
    
    set1.add(1);
    set1.add(2);
    set1.add(3);
    
    set2.add(2);
    set2.add(3);
    set2.add(4);
    
    Set<Integer> setView = Sets.intersection(set1, set2);
    System.out.println(setView);
    
    //setView.remove(3);
    Set<Integer> newSet = Sets.newHashSet(setView);
    newSet.remove(3);
    System.out.println(newSet);
  }
}
